import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { createPinia } from 'pinia'
import store from './store'
import { createI18n } from 'vue-i18n'
import messages from './locales'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'


const app = createApp(App)
const pinia = createPinia()
app.use(router)
app.use(pinia)
const settingStore = store.settingStore()
const lang = settingStore.getLanguage
const i18n = createI18n({
    legacy: false,
    locale: lang, // 设置默认语言
    globalInjection: true,
    messages,
})
app.use(i18n)
app.use(ElementPlus, { locale: messages[lang] })
app.mount('#app')
window.vm = app